package utils;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class HzdlJsonResult {

    private Integer code; // 状态码
    private String msg; // 提示信息
    private Object data; // 数据
    private Integer count; // 总条数


    public static HzdlJsonResult ok(Object obj){
        return new HzdlJsonResult(0,"ok",obj,null);
    }
    public static HzdlJsonResult ok(Object obj,Integer count){
        return new HzdlJsonResult(0,"ok",obj,count);
    }

    public static HzdlJsonResult error(Integer code , String msg){
        return new HzdlJsonResult(code,msg,null,null);
    }
}
